<?php $this->load->view('left'); ?>

<style type="text/css">
#title1  a{
        display:block;
        float:left;
        color:white;
        width:210px;
        height:37px;
    font-size:14px;
        font-weight:bold;
        text-align:center;
        padding-top:8px;
        background:url(images/bg-menu-item-green.gif) no-repeat;
        margin-bottom:50px;
}
table{
        clear:both;
}
</style>
<script type="text/javascript">
        function check()
        {
                if($("#fid").val()=="")
                {
                        $("#show").html("<font color=red > You have not select first category!</font>");
                        return false;
                }
                else
                {
                        if($("#second_cate").val()=="")
                        {
                                $("#show").html("<font color=red >Second category can not empty !</font>");
                        return false;
                                }
                }
        }
</script>
<div id="title1">
<!-- <?php echo anchor(site_url('welcome/add_category'),'Add First Category'); ?> -->
<?php echo anchor(site_url('welcome/add_second_category'),'Add Second Category');?>
</div>
<br />
<br />
<br />
<br />
<form action="<?php echo site_url('welcome/insert_second_category')?>" method="post" >
        <table>
    <tr><td>&nbsp;&nbsp;</td><td id="show"></td></tr>
        <tr>
        <td>Category Name:</td>
        <td>
                        <select name="fid" id="fid">
                        <option value="">Select First Categoty</option>
                        <?php foreach ($cate as $msg):?>
                                <?php echo "<option  value=\"".$msg['classify_id']."\" />".$msg['type']."</option>";?>
                        <?php endforeach;?>
                        </select>
        </td>
        </tr>
        <tr><td>Add Second Category:</td><td><input type="text" name="second_cate" id="second_cate"/></td></tr>
        <tr><td colspan=2><input type="submit" name="sub" id="sub" value="ADD" onclick="return check()"/></td></tr>
        </table>
</form>
<?php $this->load->view('right'); ?>